﻿@model IEnumerable<HanGu.Entity.VBemaLecturerInfo>
@{
    ViewBag.Title = "讲坛安排";
    Layout = "~/Views/Shared/Main.cshtml";
    TempData["sidecalss"] = "EveryDayWisdom";
    var SearchParma = ViewData["SearchParma"] as HanGu.Entity.UniversallySearchParam ?? new HanGu.Entity.UniversallySearchParam();
    int i = 1;

}
@section Header
{
    <style>
        #partContent
        {
            width: 100%;
        }
        .movieContain
        {
            width: 100%;
            margin-top: 5px;
        }
        .ContentTitleRight
        {
            width: 300px;
        }
    </style>
}
@section Banner
{
    @Html.Partial("Banner")
}
@section Content{
    <form id="RostrumspagerForm" method="post" action="/rostrum/plans">
    <input type="hidden" name="pageNum" value="@SearchParma.Pagination.CurrentIndex" />
    <input type="hidden" name="PageTotal" value="@SearchParma.Pagination.PageTotal" />
    <input type="hidden" name="RowCount" value="@SearchParma.Pagination.RowCount" />
    <input type="hidden" name="orderField" value="${param.orderField}" />
    <input type="hidden" name="Title" value="@SearchParma.Ttile" />
    <input type="hidden" name="StarTime" value="@SearchParma.StarDateTime" />
    <input type="hidden" name="EndTime" value="@SearchParma.EndDateTime" />
    </form>
    <div class="contentLeft" style="width: 100%;">
        <table cellpadding="0" cellspacing="0" id="partContent">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/rostrumTitle.gif" width="145" height="26" alt=""></div>
                        <div class="ContentTitleRight" style="padding-top: 0px">
                            <input type="text" name="key" class="textInput focus" value="@SearchParma.Ttile" />
                            <input type="button" class="buttonContent" value="搜索" onclick="Search()" />
                            <script>
                                function Search() {
                                    var pageform = $('#@ViewData["pageform"]');
                                    var keyVal = $("input[name='key']").val();
                                    $("input[name='Title']", pageform).val(keyVal);
                                    $("input[name='pageNum']", pageform).val(1);
                                    pageform.submit();

                                }
                            </script>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="Educationlist">
                        @foreach (var item in Model)
                        {
                            if (i % 2 != 0)
                            {
                            <div class="contentLeft" style="width: 310px;">
                                <div class="movieContain">
                                    <div class="parent_panel">
                                        <div class="movie_image_panel">
                                            @{
                                var titlePic = string.Empty;
                                if (!string.IsNullOrEmpty(item.TitlePic))
                                { titlePic = item.TitlePic; }
                                else
                                { titlePic = "/Content/default.jpg"; } 
                                            }
                                            <a href="/rostrum/Content/@item.ID">
                                                <img src="@titlePic" alt="@item.Title" style="height:80px; width:150px;"/></a>
                                        </div>
                                        <div class="movie_text_panel">
                                            <ul>
                                                <li>讲师：
                                                    @{
                                                    if (item != null && !string.IsNullOrEmpty(item.LecturerID) && !string.IsNullOrEmpty(item.LecturerName))
                                                    {
                                                    string[] lecturerids = item.LecturerID.Split(',');
                                                    string[] lecturerNames = item.LecturerName.Split(',');
                                                    if (lecturerids != null && lecturerNames != null && lecturerids.Length == lecturerNames.Length)
                                                    {
                                                    for (int j = 0; j < lecturerids.Length; j++)
                                                    {
                                                    <a href="/Lecturers/detail/@lecturerids[i]">@lecturerNames[j]</a>
                                                    }
                                                    }
                                                    }
                                                    }
                                                </li>
                                                <li>主题： <a href="/rostrum/Content/@item.ID">@item.Title</a></li>
                                                <li>时间：<span formatdate="yyyy-MM-dd">@item.PlayTime</span></li>
                                                @*<li>点击数：<span style="color: Red">@item.Clicks</span></li>*@
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            }
                            else
                            {
                            <div class="contentRight" style="width: 310px;">
                                <div class="movieContain">
                                    <div class="parent_panel">
                                        <div class="movie_image_panel">
                                            @{
                                var titlePic = string.Empty;
                                if (!string.IsNullOrEmpty(item.TitlePic))
                                { titlePic = item.TitlePic; }
                                else
                                { titlePic = "/Content/default.jpg"; } 
                                            }
                                            <a href="/rostrum/Content/@item.ID">
                                                <img src="@titlePic" alt="@item.Title" style="height:80px; width:150px;"/></a>
                                        </div>
                                        <div class="movie_text_panel">
                                            <ul>
                                                <li>讲师：
                                                @{
                                                    if (item != null && !string.IsNullOrEmpty(item.LecturerID) && !string.IsNullOrEmpty(item.LecturerName))
                                                    {
                                                    string[] lecturerids = item.LecturerID.Split(',');
                                                    string[] lecturerNames = item.LecturerName.Split(',');
                                                    if (lecturerids != null && lecturerNames != null && lecturerids.Length == lecturerNames.Length)
                                                    {
                                                    for (int j = 0; j < lecturerids.Length; j++)
                                                    {
                                                    <a href="/Lecturers/detail/@lecturerids[i]">@lecturerNames[j]</a>
                                                    }
                                                    }
                                                    }
                                                    }
                                                </li>
                                                <li>主题： <a href="/rostrum/Content/@item.ID">@item.Title</a></li>
                                                <li>时间：<span formatdate="yyyy-MM-dd">@item.PlayTime</span></li>
                                                @*<li>点击数：<span style="color: Red">@item.Clicks</span></li>*@
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            }
                            i += 1;
                        }
                        <div class="clearline" />
                    </div>
                    @Html.Partial("PageBar")
                </td>
            </tr>
        </table>
    </div>
}
@section Side{
    @Html.Partial("Side")
}
